package Libs.Utils.Strings
{
	public const IndexOfAny:Function = function( source:String, anyOf:Array, startIndex:uint = 0, count:int = - 1 ):int
    {
        if( anyOf && source != null && source != "" )
        {
            var i:int;
            var l:int = anyOf.length ;
            var endIndex:int ;
            if( ( count < 0 ) || ( count > l - startIndex ) )
            {
                endIndex = l - 1;
            }
            else
            {
                endIndex = startIndex + count - 1;
            }
            for( i = startIndex ; i <= endIndex ; i++ )
            {
                if( source.indexOf( anyOf[i] ) > - 1 )
                {
                    return i ;
                }
            }
        }
        return - 1 ;
    };
}